/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-03-19
 * Time: 15:05
 */
public class test3 {
    public boolean isPalindrome(String ss) {
        StringBuffer tmp = new StringBuffer();
        char[] s = ss.toCharArray();
        for(char ch:s){
            if(ch>='0' && ch<='9'){
                tmp.append(ch);
            }else if(ch>='a' && ch<='z'){
                tmp.append(ch);
            }else if(ch>='A' && ch<='Z'){
                ch = Character.toLowerCase(ch);
                tmp.append(ch);
            }
        }
        s = tmp.toString().toCharArray();
        int left = 0;
        int right = s.length-1;
        while(left<=right){
            if(s[left]!=s[right]){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
